home *** CD-ROM | disk | FTP | other *** search
- /* outfile.c - write out sorted file */
- #include "stdio.h"
- #include "sorttext.h"
-
- FILE *do_open() ;
-
- int outfile(prec,nrec,oname)
- char *prec[] ; /* array of pointers to records */
- int nrec ; /* number of records to be output */
- char oname[] ; /* output file name */
- {
- int i ;
- FILE *ofile ; /* output runs this file */
-
- ofile = do_open(oname,"w") ; /*open output merge file */
-
- for(i=1 ; i<nrec ; i=i+1) /* write records in sorted order */
- { putrec(prec[i],ofile) ; } /* output one record */
-
- do_close(ofile,oname) ; /* close the file */
- }
-
-